package com.cloud.poetry.base.feign.fallback;

import com.cloud.poetry.base.feign.SystemFeignClient;
import com.cloud.poetry.base.feign.fallback.impl.SystemFeignClientImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author mengxj
 */
@Component
public class SystemFeignClientFallBack implements FallbackFactory<SystemFeignClient> {

    @Override
    public SystemFeignClient create(Throwable throwable) {
        SystemFeignClientImpl client = new SystemFeignClientImpl();
        client.setThrowable(throwable);
        return client;
    }
}
